package org.opportunity.wishlist.travelwish.pojo.model;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Sort;
import org.hibernate.annotations.SortType;

@Entity
@Table(name="facets")
public class Facet implements Serializable {

    private static final long serialVersionUID = -6706155889934540326L;
    
    private long id;
    private String propertyName;
    private String propertyDescription;
    private Set<Focus> focus = new HashSet<Focus>(0);
    
    public Facet() {
    }

    @Id
    @GeneratedValue
    @Column(name="id")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
 
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy="facet")
    @Sort(type=SortType.NATURAL)
    public Set<Focus> getFocus() {
        return focus;
    }

    public void setFocus(Set<Focus> focus) {
        this.focus = focus;
    }

    @Column(name="property_name")
    public String getPropertyName() {
        return propertyName;
    }

    public void setPropertyName(String propertyName) {
        this.propertyName = propertyName;
    }

    @Column(name="property_description")
    public String getPropertyDescription() {
        return propertyDescription;
    }

    public void setPropertyDescription(String propertyDescription) {
        this.propertyDescription = propertyDescription;
    }
    
    
}
